package com.woniu.mgr.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.injector.methods.SelectPage;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.woniu.mgr.controller.form.ApplyForModifyForm;
import com.woniu.mgr.model.VenueApply;
import com.woniu.mgr.dao.VenueApplyDao;
import com.woniu.mgr.service.VenueApplyService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.woniu.mgr.util.BeanCopyUtil;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * <p>
 * 场馆入驻申请表 服务实现类
 * </p>
 *
 * @author Silas
 * @since 2023-02-15
 */
@Service
public class VenueApplyServiceImpl extends ServiceImpl<VenueApplyDao, VenueApply> implements VenueApplyService {

    @Resource
    private VenueApplyDao vueApplyDao;

    @Override
    public IPage<VenueApply> list(Integer page, Integer size) {
        //分页查询
        Page<VenueApply> pages = new Page<>(page, size);
        QueryWrapper<VenueApply> wrapper = new QueryWrapper<>();
        Page<VenueApply> page1 = vueApplyDao.selectPage(pages, wrapper);
        return page1;
    }

    @Override
    public void afModify(ApplyForModifyForm applyForModifyForm) {
        //入驻申请修改全部
        VenueApply venueApply = BeanCopyUtil.copyObject(applyForModifyForm, VenueApply.class);
        updateById(venueApply);
    }


}
